package com.hu.ta.assignment6.evaluation;

public class ComparisonResults {

	private int num = 0;
	private int TP = 0;
	private int FP = 0;
	private int FN = 0;
	private int TN = 0;
	
	
	public ComparisonResults(int num, int TP, int FP, int FN, int TN) {
		this.num = num;
		this.TP = TP;
		this.FP = FP;
		this.FN = FN;
		this.TN = TN;
	}
	
	public int getNum() { return num; }
	public int getFP() { return FP; }
	public int getTP() { return TP; }
	public int getFN() { return FN; }
	
	public double getPrecision() { return TP/(double)(TP+FP); }
	public double getRecall()	{ return TP/(double)(TP+FN); }
	public double getFMeasure() { return 2*(getPrecision()*getRecall())/(getPrecision()+getRecall()); }
	public double getAccuracy() { return (TP+TN)/(double)(TP+TN+FP+FN); }
	
	public void add(ComparisonResults r) {
		this.num += r.num;
		this.TP += r.TP;
		this.FP += r.FP;
		this.FN += r.FN;
		this.TN += r.TN;
	}
}
